<?php
	// views/brands/index.ctp
?>
<h2>Các hãng sản xuất</h2>
	
	<?php echo $form->create('Delete', array('url' => '/brands/multiDelete'))?>
	<table class="widefat post fixed" cellspacing="0">
		<thead>
			<tr>
				<th scope="col" id="" class="" style="width:15px"><input type="checkbox"></th>
				<th scope="col" id="" class="" style="width:300px"><?php echo$paginator->sort('Hãng sản xuất', 'name')?></th>
				<th scope="col" id="" class="" style="width:150px">LOGO</th>
				<th scope="col" id="" class="" style="width:50px"><?php echo$paginator->sort('Ngày tạo', 'created_date')?></th>
			</tr>
		</thead>
	
		<tfoot>
			<tr>
				<th scope="col" id="" class="" style="width:15px"><input type="checkbox"></th>
				<th scope="col" id="" class="" style="width:300px"><?php echo$paginator->sort('Hãng sản xuất', 'name')?></th>
				<th scope="col" id="" class="" style="width:150px">LOGO</th>
				<th scope="col" id="" class="" style="width:50px"><?php echo$paginator->sort('Ngày tạo', 'created_date')?></th>
			</tr>
		</tfoot>
	
		<tbody>
			<?php 
			foreach ($brands as $brand)
			{
			?>
			<tr id="post-<?php echo $brand['Brand']['id']?>" class="" valign="top">
				<th scope="row" class="check-column" style="width:3%">
					<?php echo $form->input("record.".$brand['Brand']['id'], array('label' => '','type' => 'checkbox'))?>
				</th>
				<td class="post-title column-title">
					<a class="row-title" href="#" title="Edit &quot;<?php echo $brand['Brand']['name']?>" style="font-weight:bold">
						<?php echo $brand['Brand']['name']?>
					</a>
					<div class="row-actions">
						<span class="view"><a href="<?php echo $html->url('/brands/add')?>" title="Add" rel="permalink">Add</a> | </span>
						<span class="edit"><a href="<?php echo $html->url('/brands/edit/'.$brand['Brand']['id'])?>" title="Edit">Edit</a> | </span>
						<span class="delete"><a class="submitdelete" title="Delete" href="<?php echo $html->url('/brands/delete/'.$brand['Brand']['id'])?>" onclick="if ( confirm('You are about to delete \'<?php echo$brand['Brand']['name']?>\'\n \'Cancel\' to stop, \'OK\' to delete.') ) { return true;}return false;">Delete</a></span>
					</div>
				</td>
				<td class="post-title column-title">
					<?php echo $html->image($brand['Brand']['logo'], array('style'=>'width:150px;'))?>
				</td>
				
				<td class="date column-date">
					<abbr title="<?php echo $time->format('d/m/y h:m:s', $brand['Brand']['created'])?>"><?php echo$time->format('d/m/y', $brand['Brand']['created'])?></abbr>
				</td>
			</tr>
			<?php 
			}
			?>
			
		</tbody>
	</table>
	
	<!-- bof tablenav -->
	<div class="tablenav">
		<div class="tablenav-pages">
			<span class="displaying-num"><?php echo $paginator->counter(array( 'format' => 'Display %start%-%end% of %count%')); ?></span>
			<?php
				echo $paginator->prev('«', array('class' => 'prev page-numbers'));
				echo ' '.$paginator->numbers(array('class' => 'page-numbers', 'separator' => ' ', 'modulus' => '5')).' ';
				echo $paginator->next('»', array('class' => 'next page-numbers'));
			?>
		</div>
		<div class="alignleft actions">
			<?php echo $form->submit('Delete', array('name' => 'doaction2', 'class' => 'button-secondary action', 'div' => false))?> 
			<br class="clear">
		</div>
		<br class="clear">
	</div>
	<!-- eof tablenav -->
	<?php echo$form->end()?>